<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	
	<xsl:template name="header2">
		<div class="top-menu select-menu" style="margin-left: 2.5em;">
			<div id="select-title" class="title-menu">Автосалон</div>
			<a href="/cars/salon"><div id="select-point" class="menu" >Автомобили в салоне</div></a>
			<a href="/cars/asorder"><div class="menu" >Автомобили на заказ</div></a>
			<div class="menu" >О компании</div>
		</div>
		<div class="top-menu " >
			<div class="title-menu">объявления</div>
			<div class="menu" >купить авто</div>
			<a href="/admin/cars/add"><div class="menu" >продать авто</div></a>
		</div>
		<div class="top-menu " >
			<div class="title-menu">техцентр</div>
			<div class="menu" >Сигнализации</div>
			<div class="menu" >Доп.оборудование</div>
		</div>
		<div class="top-menu " >
			<div class="title-menu">услуги</div>
			<div class="menu" >Кредиты</div>
			<div class="menu" >Страхование</div>
			<div class="menu" >Прием на комиссию</div>
			<div class="menu" >Срочный выкуп</div>
		</div>
		<div class="top-menu " >
			<div class="title-menu"></div>
			<div class="menu" >Вакансии</div>
			<a href="/faq"><div class="menu" >FAQ</div></a>
			<xsl:if test="//page/logined/@status=2">
				<a href="/admin/questions"><div class="menu">Неотвеченные вопросы</div></a>
				<a href="/admin/questions"><div class="menu">Неопубликованные объявления</div></a>
			</xsl:if>
		</div>
	</xsl:template>
	
	<xsl:template name="header">
		
		<xsl:for-each select="//page/Category-list/Category">
			<xsl:param name="plink" ><xsl:value-of select="@link" /></xsl:param>
			<xsl:choose>
				<xsl:when test="@selected">
					<div class="top-menu select-menu" style="margin-left: 2.5em;" >
							<div id="select-title" class="title-menu"><xsl:value-of select="@title" /></div>
								<xsl:for-each select="Category">
									<xsl:if test="//page/logined/@status=2 and @hidden=2">
										<xsl:choose>
											<xsl:when test="@selected">
												<a href="/{@link}"><div id="select-point" class="menu"><xsl:value-of select="@title" /></div></a>
											</xsl:when>
											<xsl:otherwise>
												<a href="/{@link}"><div class="menu"><xsl:value-of select="@title" /></div></a>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:if>
									<xsl:if test="@hidden=1">
										<xsl:choose>
											<xsl:when test="@selected">
												<a href="/{@link}"><div id="select-point" class="menu"><xsl:value-of select="@title" /></div></a>
											</xsl:when>
											<xsl:otherwise>
												<a href="/{@link}"><div class="menu"><xsl:value-of select="@title" /></div></a>
											</xsl:otherwise>
										</xsl:choose>
									</xsl:if>
								</xsl:for-each>
							
					</div>
				</xsl:when>
				
				<xsl:otherwise>
					<div class="top-menu ">
						<div class="title-menu"><xsl:value-of select="@title" /></div>
							<xsl:for-each select="Category">
									<xsl:if test="//page/logined/@status=2 and @hidden=2">
										<a href="/{@link}"><div class="menu"><xsl:value-of select="@title" /></div></a>
									</xsl:if>
									<xsl:if test="@hidden=1">
										<a href="/{@link}"><div class="menu"><xsl:value-of select="@title" /></div></a>
									</xsl:if>
							</xsl:for-each>
					</div>
				</xsl:otherwise>
			</xsl:choose>
	</xsl:for-each>
		
	</xsl:template>
	
	<xsl:template name="top-banner">
		<xsl:for-each select="//page/elit-cars/Car">
			<div class="top-banner">
				<a href="/car/{@infoid}">
					<img src="/media/cars/{@id}/big.jpg" width="235" height="100" border="0" alt="{Model/Developer/@alias}"/>
				</a> 
			</div>
		</xsl:for-each>
		<div style="clear: both;" /> 
	</xsl:template>

</xsl:stylesheet>